package com.atguigu.servlet;

import javax.servlet.*;
import java.io.IOException;

public class FirstServlet  implements Servlet {
    @Override
    public void init(ServletConfig config) throws ServletException {

    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        System.out.println("处理请求和响应");
        //转发
//        servletRequest.getRequestDispatcher("/test/success.html").forward(servletRequest,servletResponse);
servletRequest.getRequestDispatcher("/test/success.html").forward(servletRequest,servletResponse);
    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {

    }
}
